# -*- coding: utf-8 -*-
from db.mysql import MysqlClient
from common.helper import Helper
class Arrangement( object ):
    def __init__(self):
        self.mysql = MysqlClient()
        self.name = "成人全面重疾保险"

    def pullData(self, data={}):
        for item in Helper.selectData(self.name, self.mysql):

            data["name"] = self.name
            data["company"] = "平安保险"
            data["year"] = item["year"]
            data["gender"] = "0" if item["gender"] == "F" else "1"
            data["plan"] = item["plan"]
            data["majorDisease"] = str(int(int(item["majorDisease"])/10000)) + "w"
            data["slightDisease"] = "1.5w" if item["slightDisease"] == "15000" else str(int(int(item["slightDisease"])/10000)) + "w"
            data["accidentalDie"] = str(int(int(item["accidentalDie"])/10000)) + "w"
            data["cancerMedic"] = "0" if item["cancerMedic"] == "0" else str(int(int(item["cancerMedic"])/10000)) + "w"
            data["expire"] = "1年"
            data["payType"] = "年交"
            data["price"] = item["price"]
            Helper.mergeTable( self.name,self.mysql,data )
